home *** CD-ROM | disk | FTP | other *** search
- Path: news.easynet.co.uk!usenet
- From: dgo@easynet.co.uk (dgo)
- Newsgroups: comp.lang.c++
- Subject: Arrays of structures
- Date: 8 Apr 1996 21:01:11 GMT
- Organization: easynet
- Message-ID: <4kbuqo$n6n@lemon.easynet.co.uk>
- NNTP-Posting-Host: dgo.easynet.co.uk
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.6
-
- I'm stumped on a problem.
-
- I've got a structure definition, say
-
- struct example
- {
- int a;
- int b;
- };
-
- which I want to declare an array of and initiallise. I thought it was
- simple a case of
-
- example test[3] =
- {
- { 3, 5 },
- { 4, 6 },
- { 5, 7 },
- };
-
- and what documentation I have supports this.
-
- But my C++ compiler (MSVC 1.0) just collapses saying that it cant
- convert the first parameter into a structure of type example.
-
- What am I doing wrong ? ( nb/ I don't want a solution which simply
- implements the structure members in separate arrays!)
-
- thanks
-
- daniel
-
-
-